<?php
/**
 * @name Enviroment.
 * @author Nguyen
 * @tutorial System Enviroment.
 */
class Enviroment{
	private static $_request;
	private static $_get;
	private static $_post;
	private static $_files;
	private static $_cookie;
	private static $_session;
	private static $_server;
	//	private static $_module;
	//	private static $_controller;

	/**
	 * Enviroment Instant.
	 * @var Enviroment
	 */
	private static $_enviroment;
	//	private $_action;
	//	private $_view;
	//	private $_lang;
	//	private $_plugin;
	/**
	 * Enviroment Instant.
	 * @var Enviroment
	 */
	public static function getInstance(){
		if(!self::$_enviroment){
			self::$_enviroment = new Enviroment();
		}
		return self::$_enviroment;
	}
	private function __construct(){
		$this->_initHttpRequest();
		$this->_initRoute();
		$this->_initMVC();
	}
	public function run(){
		$this->_controller->run();
	}
	/**
	 * Set up Model View Controller.
	 */
	public function _initMVC(){

	}
	/**
	 * Configuration MVC URL.
	 */
	public function _initRoute(){

	}

	/**
	 * Catch All HTTP parram.
	 */
	public function _initHttpRequest(){
		self::$_request = $_REQUEST;
		self::$_get = $_GET;
		self::$_post = $_POST;
		self::$_cookie = $_COOKIE;
		self::$_server = $_SERVER;
		self::$_files = $_FILES;
	}

	/**
	 * Return current SERVER request.
	 */
	public static function getServer(){
		return self::$_server;
	}
	/**
	 * Return current SESSION request.
	 */
	public static function getSession(){
		return self::$_session;
	}
	/**
	 * Return current COOKIES request.
	 */
	public static function getCookie(){
		return self::$_cookie;
	}
	/**
	 * Return current FILES request.
	 */
	public static function filesRequest(){
		return self::$_files;
	}
	/**
	 * Return current POST request.
	 */
	public static function postRequest(){
		return self::$_post;
	}
	/**
	 * Return current GET request.
	 */
	public static function getRequest(){
		return self::$_get;
	}
	/**
	 * Return current request.
	 */
	public static function request(){
		return self::$_request;
	}

}